package cn.edu.nju.software.zp13.assignment5.service.soapMessage;

import java.io.OutputStream;

import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import javax.xml.transform.TransformerException;
import javax.xml.transform.stream.StreamResult;

import cn.edu.nju.software.zp13.client.assignment4.xslt.Transformer;

public class SOAPMsgWriter {
	public static void writeMsg(SOAPMessage msg,OutputStream out){
		javax.xml.transform.Transformer tansformer = Transformer.wellFormatUtf8Transformer();
		try {
			tansformer.transform(msg.getSOAPPart().getContent(), new StreamResult(out));
		} catch (TransformerException | SOAPException e) {
			e.printStackTrace();
		}
	}
}
